package com.diandian.backend.product.controller;

import com.diandian.backend.product.param.*;
import com.diandian.backend.product.service.ProductOfflineStockService;
import com.diandian.backend.product.service.ProductStockSummaryService;
import com.diandian.base.boot.starter.response.BaseResult;
import com.diandian.base.boot.starter.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * [商品]线下商品库存表
 */
@RestController
@RequestMapping("/product/stock/summary")
public class ProductStockSummaryController {

    @Autowired
    private ProductStockSummaryService productStockSummaryService;

    @PostMapping("/all")
    public BaseResult getAllStockSummary(@RequestBody ProductStockSummaryGetAllParam param) {
        param.check();
        return ResultUtil.makeResult(productStockSummaryService.getAllStockSummary(param));
    }

}